const db = require('./db/db')
const mongoose = require('mongoose')
const BookModel = require('./models/BookModel')

db(
  () => {
    BookModel.create({
      name: '西游记11111',
      author: '吴承恩11111',
      price: 19.9
    })
      .then((data) => {
        console.log(data)
        mongoose.disconnect()
      })
      .catch((err) => {
        console.log(err)
      })
  },
  () => {
    console.log('连接失败...')
  }
)
